# /bin/bash

# Check the RPM installation

for i in $(find $1 -iname *.rpm)
    do
        name=$(basename $i)
        name=${name%%-[0-9]*}
        
        mkdir -p $2
        dnf install -y $i > $2/$name.log 2>&1
        if [ $? == 0 ]; then 
        dnf remove $i
        fi
    done